home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98a.txt
/
000139_icon-group-sender _Mon Mar 16 16:21:26 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA21320
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 16 Mar 1998 16:21:26 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA12573; Mon, 16 Mar 1998 16:21:25 -0700
Message-Id: <350DA0F2.6075@gte.net>
Date: Mon, 16 Mar 1998 16:00:18 -0600
From: Mark Evans <evans@gte.net>
Reply-To: evans@gte.net
Organization: None
X-Mailer: Mozilla 3.01 (Win95; I)
Mime-Version: 1.0
To: icon-group@optima.CS.Arizona.EDU
Cc: evans@gte.net
Subject: Re: image
References: <199803140354.VAA03466@axp.cmpu.net> <350D49AD.3539@gte.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1305
I can answer my own question. The function 'escape' that is linked by
xcode essentially reverses an image() call.
As for the high ASCII characters, here is a little utility routine that
does the job, but I would much rather have a library call for this.
Mark
____________________________
link xcode
global diagnose
procedure main(av)
diagnose := open("diagnose.txt","w")
write(diagnose,image_NotHighChars("\n\r\tABCDEF\xde|K!\\"))
write(diagnose,"\n\n\n")
close(diagnose)
end
procedure image_NotHighChars(str)
# lets you print chars native that are ASCII > 128
# Icon's "image" routine gives nasty hex escape codes for these
local img_str,new_str,esc_seq
img_str := image(str)
write(diagnose,"img_str is -->",img_str,"<---")
new_str := ""
img_str ?
{
while new_str ||:= tab(upto('\\')) do
{
write(diagnose,"new_str is -->",new_str,"<---")
esc_seq := move(2)
write(diagnose,"esc_seq is -->",esc_seq,"<---")
if (esc_seq) == "\\x" then # hexadecimal ASCII code
{
new_str ||:= escape(esc_seq ||:= move(2))
}
else
{
new_str ||:= esc_seq
}
}
new_str ||:= tab(0) # anything after last esc seq
}
return new_str
end